Skip to content

fix(cli): sanitize project argument newlines - #1456

Merged
BYK merged 1 commit into
mainfrom
seer/fix/cli-project-arg-newlines
Oct 9, 2026
Merged

BYK merged 1 commit into
mainfrom
seer/fix/cli-project-arg-newlines

Conversation

@sentry

@sentry sentry Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

This PR fixes an issue where parseOrgProjectArg would fail with a ValidationError: Invalid project slug: contains a newline. when given multi-line input.

Previously, parseOrgProjectArg only used arg.trim(), which removes leading/trailing whitespace but leaves internal newlines intact. This was particularly problematic for AI agents (e.g., Codex, Claude) that often pass arguments with appended output or notes after a newline (CLI-1RA).

The fix introduces a shared helper function, firstNonBlankLine, which extracts and returns only the first non-blank line from the input, trimming it. This aligns the behavior of parseOrgProjectArg with parseIssueArg, which already implemented similar logic to address a related issue (CLI-1G1).

This change ensures that project arguments are correctly sanitized, preventing crashes and improving the robustness of CLI commands that parse project identifiers.

Fixes CLI-1RA

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Oct 9, 2026
@BYK
BYK enabled auto-merge (squash) October 9, 2026 11:00
@BYK
BYK merged commit 69e011a into main Oct 9, 2026
23 checks passed
@BYK
BYK deleted the seer/fix/cli-project-arg-newlines branch October 9, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant